﻿using Autofac;
using Project.Yan.Net.BLL;
using Project.Yan.Net.DAL;

namespace Project.Yan.Net.Autofac
{
    public class DALModule : Module
    {
        /// <summary>
        /// 注册所有DAL服务
        /// </summary>
        /// <param name="builder"></param>
        protected override void Load(ContainerBuilder builder)
        {
            //builder.RegisterType<UserRepository>().As<IUserRepository>();
            // 其他DAL服务注册
            builder.RegisterAssemblyTypes(typeof(UserRepository).Assembly).Where(x => x.FullName.EndsWith("Repository")).AsSelf().AsImplementedInterfaces();

        }
    }

}
